// 产品管理API服务
import request from "@/common/utils/request.js";
import { stringify } from "querystring";

const BASE_URL = "/api/product";


// 获取产品详情
export const getProductById = (id) => {
  return request({
    url: `${BASE_URL}/${id}`,
    method: "GET",
  });
};

// 获取产品列表
export const getProductList = (params) => {
  return request({
    url: BASE_URL+'/tableList',
    method: "GET",
    data:params
  });
};
// 获取分类接口
export const getCategaryList = (params) => {
  return request({
    url: '/api/category/list',
    method: "GET",
    data:params
  });
};
// 创建自定义产品详情
export const addSelfProduct = (params) => {
  return request({
    url: `/api/product-requirement`,
    method: "post",
    data:params
  });
};
//客户确认订单
export const conformOrder = (params) => {
  return request({
    url: `/api/product-requirement/${params.id}/confirm `,
    method: "post",
    data:params
  });
};